<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>角色管理</title>
	<%@ include file="/common/meta.jsp" %>
    <%@ include file="/common/public_input.jsp" %>
	<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			//$("#name").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate({
				rules: {
					name: {
						required: true,
						remote: "check_role_name.action?oldRoleName=" + $("#oldRoleName").val()
					}

				},
				messages: {
					name: {
						remote: "角色已存在"
					}

				}
			});
		});
	</script>
</head>

<body>
<div class="div-tabs-nav">
        <ul class="ui-tabs-nav">
            <li class="ui-tabs-selected">基本信息</li>
        </ul>
</div>

<%--	<h2><s:if test="id == null">创建</s:if><s:else>修改</s:else>角色</h2>--%>
<div class="ui-tabs-panel">
	<form id="inputForm" action="${ctx}/auth/role/save.action" method="post">
        <div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
        <div>角色<s:if test="id!=null">信息</s:if><s:else>创建</s:else></div>
		<input type="hidden" name="id" value="${id}"/>
		<input type="hidden" id="oldRoleName" name="oldRoleName" value="${name}"/>
		<table class="noborder">
			<tr>
				<td>角色名:</td>
				<td><s:textfield id="name" name="name" size="40" /></td>
			</tr>
			<tr>
				<td>授权:</td>
				<td>
					<s:checkboxlist name="checkedAuthIds" list="allAuthorityList" listKey="id"
										listValue="description" theme="custom"/>
                    <s:checkbox name="checkedAuthIds" value="true" fieldValue="2"  onclick="return false;"/>浏览权限
                    <%--<input type="checkbox" name="checkedAuthIds" checked="true" value="2" disabled="disabled">浏览权限--%>
				</td>
			</tr>
		</table>
           <div align="left">
                <security:authorize ifAnyGranted="AUTH_MANAGER_AUTH,AUTH_ALL">
                    <input class="button" type="submit" value="提交"/>&nbsp;
                </security:authorize>
                <input type="reset" class="input-button" value="重置"/>
          </div>
	</form>
</div>
</body>
</html>
